package com.hsogoo.collate.domain;

import lombok.Data;
import org.apache.commons.lang.StringUtils;

@Data
public class SftpBean {

    private String remoteAddress;
    private int remotePort;
    private String username;
    private String password;

    public boolean validate() {
        if (this.remotePort == 0) {
            this.remotePort = 22;
        }
        if ((StringUtils.isBlank(this.remoteAddress)) || (StringUtils.isBlank(this.username)) || (StringUtils.isBlank(this.password)) || (this.remotePort <= 0)) {
            return false;
        }
        return true;
    }

}